<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>欢迎页面-L-admin1.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />

    <link rel="shortcut icon" th:href="@{~/UI/favicon.ico}" type="image/x-icon" />
    <link rel="stylesheet" th:href="@{~/UI/css/font.css}">
    <link rel="stylesheet" th:href="@{~/UI/css/xadmin.css}">
    <script type="text/javascript" th:src="@{~/UI/js/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{~/UI/lib/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{~/UI/js/xadmin.js}"></script>

    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  
  <body class="form-wrap" >

  <div class="layui-fluid">
    <div class="layui-card">
      <!--<div class="layui-card-header">修改个人信息</div>-->
      <div class="layui-card-body" style="padding: 15px;">
        <form class="layui-form" action="" lay-filter="component-form-group">

            <div class="layui-form-item">
                <label class="layui-form-label">用户ID</label>
                <div class="layui-input-block">
                    <input type="text" name="uid" lay-verify="title" autocomplete="off" class="layui-input" th:value="${session.userEntity.uid}" readonly>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">用户名</label>
                <div class="layui-input-block">
                    <input type="text" name="uname" lay-verify="title" autocomplete="off" class="layui-input" th:value="${session.userEntity.uname}" readonly>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">余额</label>
                <div class="layui-input-block">
                    <input type="text" name="ubalance" lay-verify="title" autocomplete="off" class="layui-input" th:value="${session.userEntity.ubalance}" readonly>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">手机号</label>
                <div class="layui-input-block">
                    <input type="text" name="uphone" lay-verify="title" autocomplete="off" class="layui-input" th:value="${session.userEntity.uphone}" readonly>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">身份证</label>
                <div class="layui-input-block">
                    <input type="password" name="identity" id="identity" lay-verify="title" autocomplete="off" class="layui-input" th:value="${session.userEntity.ucid}" readonly>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"></label>
                <div class="layui-input-block">
                    <input type="button" id="but" value="显示" class="layui-btn layui-btn-primary">
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">用户类型</label>
                <div class="layui-input-block">
                    <input th:if="${session.userEntity.utipe} eq 2" type="text" name="utipe" lay-verify="title" autocomplete="off" class="layui-input" th:value="普通用户" readonly>
                    <input th:if="${session.userEntity.utipe} eq 1" type="text" name="utipe" lay-verify="title" autocomplete="off" class="layui-input" th:value="管理员" readonly>
                </div>
            </div>

          <!--<div class="layui-form-item layui-layout-admin">-->
            <!--<div class="layui-input-block">-->
              <!--<div class="layui-footer" style="left: 0;">-->
                <!--<button class="layui-btn" lay-submit="" lay-filter="component-form-demo1">确认修改</button>-->
                <!--&lt;!&ndash;<button type="reset" class="layui-btn layui-btn-primary">重置</button>&ndash;&gt;-->
              <!--</div>-->
            <!--</div>-->
          <!--</div>-->

        </form>
      </div>
    </div>
  </div>

  <script>
      $(function () {

          // 通过点击事件实现密码的显示或隐藏功能
          $("#but").click(function () {
              // 通过id选择器获取当前输入框的属性
              var type = $("#identity").attr("type");
              /**
               * 若当前属性为“password”,则切换图片，并修改属性为“text”，实现密码的显示功能
               * 若当前属性为“text"，同样切换图片，并修改属性为”password",实现密码的再次隐藏功能
               */
              if(type == "password"){
                  $("#but").attr('value','隐藏');
                  $("#identity").prop("type", "text");
              }else {
                  $("#but").attr('value','显示');
                  $("#identity").prop("type", "password");
              }
          });
      });

  </script>
    
  <script>
  layui.config({
    base: '../../../layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form', 'laydate'], function(){
    var $ = layui.$
    ,admin = layui.admin
    ,element = layui.element
    ,layer = layui.layer
    ,laydate = layui.laydate
    ,form = layui.form;
    
    form.render(null, 'component-form-group');

    laydate.render({
      elem: '#LAY-component-form-group-date'
    });
    
    /* 自定义验证规则 */
    form.verify({
      title: function(value){
        if(value.length < 5){
          return '标题至少得5个字符啊';
        }
      }
      ,pass: [/(.+){6,12}$/, '密码必须6到12位']
      ,content: function(value){
        layedit.sync(editIndex);
      }
    });
    
    /* 监听指定开关 */
    form.on('switch(component-form-switchTest)', function(data){
      layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
        offset: '6px'
      });
      layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
    });
    
    /* 监听提交 */
    form.on('submit(component-form-demo1)', function(data){
      parent.layer.alert(JSON.stringify(data.field), {
        title: '最终的提交信息'
      })
      return false;
    });
  });
  </script>


<style id="LAY_layadmin_theme">.layui-side-menu,.layadmin-pagetabs .layui-tab-title li:after,.layadmin-pagetabs .layui-tab-title li.layui-this:after,.layui-layer-admin .layui-layer-title,.layadmin-side-shrink .layui-side-menu .layui-nav>.layui-nav-item>.layui-nav-child{background-color:#20222A !important;}.layui-nav-tree .layui-this,.layui-nav-tree .layui-this>a,.layui-nav-tree .layui-nav-child dd.layui-this,.layui-nav-tree .layui-nav-child dd.layui-this a{background-color:#009688 !important;}.layui-layout-admin .layui-logo{background-color:#20222A !important;}</style>
</body>

</html>